/*
 * GMMCallable.java
 * Created on Nov 4, 2008
 *
 * Glacéo Internet Platform
 * http://sourceforge.net/projects/chm/
 *
 * Copyright (c) 2005-2009, Jens and Jan Janke (VirtualHockey Project)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.hockeo.vhbase.seasoncycle.movemaking;

import java.util.concurrent.Callable;
import java.util.concurrent.Executor;

/**
 * Represents a callable unit which is responsible for executing move-making
 * tasks. Please be aware that this task is intended to be run in parallel by
 * using e.g. the {@link Executor} facility.
 *
 * @version $Id$
 * @author jjanke
 */
public final class GMMCallable implements Callable<GMMResult>
{
  private final IGMoveMaker d_moveMaker;

  /**
   * Constructs a new GMMCallable that will execute the passed in move maker
   * when its {@link #call()} method is called.
   *
   * @param moveMaker the moveMaker that should be executed.
   */
  public GMMCallable( final IGMoveMaker moveMaker )
  {
    d_moveMaker = moveMaker;
  }

  public GMMResult call() throws Exception
  {
    return d_moveMaker.execute();
  }
}
